﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading.Tasks;

namespace ScanDispatcher.Service
{
    public partial class SmtpService : ServiceBase
    {
        public SmtpService()
        {
            InitializeComponent();
        }

        protected override void OnStart(string[] args)
        {
            Task.Run(() =>
            {
                SmtpServer.Serve();
            });
        }

        protected override void OnStop()
        {
            SmtpServer.run = false;
        }
    }
}
